﻿using Digitalmes.Model;
using Digitalmes.Model.FactoryManagement;
using Digitalmes.Model.ProcessManagement;
using Digitalmes.Model.ProductManagement;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using WalkingTec.Mvvm.Core;

namespace Digitalmes.Model.ProcessManagement
{
    /// <summary>
    /// ProcessRoute
    /// </summary>
	[Table("ProcessRoute")]

    [Display(Name = "_Model.ProcessRoute")]
    public class ProcessRoute : BasePoco,IPersistPoco,ITenant
    {
        [Display(Name = "_Model._ProcessRoute._ProductId")]
        [Comment("产品")]
        public long? ProductId { get; set; }

        public Product Product { get; set; }



        [Display(Name = "_Model._LineShift._Line")]
        [Comment("产线")]
        public long? LineId { get; set; }

        public ProductionLine Line { get; set; }


        [Display(Name = "_Model._ProcessRoute._RoutingCode")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("工艺路线编码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string RoutingCode { get; set; }
        [Display(Name = "_Model._ProcessRoute._RoutingName")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("工艺路线名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string RoutingName { get; set; }
        [Display(Name = "_Model._ProcessRoute._Active")]
        [Comment("激活")]

        public bool Active { get; set; } = false;

        [Display(Name = "_Model._ProcessRoute._Aux_1")]
        [Comment("备用")]
        public string Aux_1 { get; set; }
        [Display(Name = "_Model._ProcessRoute._Aux_2")]
        [Comment("备用")]
        public string Aux_2 { get; set; }
        [Display(Name = "_Model._ProcessRoute._ProductCode")]
        [Comment("产品编码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string ProductCode { get; set; }
        [Display(Name = "_Model._ProcessRoute._ProductName")]
        [Comment("产品名称")]
        public string ProductName { get; set; }
        [Key]
        [Display(Name = "_Model._ProcessRoute._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._ProcessParameter._Route")]
        [InverseProperty("Route")]
        public List<ProcessParameter> ProcessParameter_Route { get; set; }
        [Display(Name = "_Model._ProcessRouteItem._Routie")]
        [InverseProperty("Routie")]
        public List<ProcessRouteItem> ProcessRouteItem_Routie { get; set; }
        [Display(Name = "_Model._ProcessResults._Rotue")]
        [InverseProperty("Rotue")]
        public List<ProcessResults> ProcessResults_Rotue { get; set; }
        [Display(Name = "_Model._ProcessRoute._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
